<template>
  <div class="shop">
    <div class="shophead">
      <!-- {{ shopinfo }} -->
      <div class="shopname">
        <p>
          {{ shopinfo.name }}
        </p>
        <p>
          <img src="/img/star24_on@2x.png" alt="" />
          <img src="/img/star24_on@2x.png" alt="" />
          <img src="/img/star24_on@2x.png" alt="" />
          <img src="/img/star24_half@2x.png" alt="" />
          <img src="/img/star24_off@2x.png" alt="" />
          &emsp; (24) &emsp; 月售单
        </p>
        <div class="small">
          <van-icon name="like" class="heart" />
          <p>收藏</p>
        </div>
      </div>

      <!-- 配送 -->
      <div class="deliveryprice">
        <ul class="small2">
          <li>
            <p>起送价</p>
            <p><span class="pricenum">20</span>元</p>
          </li>
          <li>
            <p>商家配送</p>
            <p><span class="pricenum">4</span>元</p>
          </li>
          <li>
            <p>平均配送时间</p>
            <p><span class="pricenum">38</span>元</p>
          </li>
        </ul>
      </div>

      <!-- 公告活动 -->
      <div class="activity">
        <p>公告与活动</p>
        <p class="red">
          {{ shopinfo.bulletin }}
        </p>
        <ul class="supports">
          <li>
            <img src="/img/decrease_3@2x.png" alt="" />
            {{ shopinfo.supports[0].description }}
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "shop",
  data() {
    return {
      shopinfo: []
    };
  },
  mounted() {
    this.$axios.get("/api/data.json").then(res => {
      console.log(res);
      this.shopinfo = res.data.seller;
    });
  }
};
</script>

<style lang="scss" scoped>
.shop {
  width: 100%;
  .shophead {
    width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    .shopname {
      width: 100%;
      padding: 10px;
      line-height: 36px;
      position: relative;
      border-bottom: 1px solid #ccc;
      p:nth-of-type(1) {
        font-size: 16px;
      }
      p:nth-of-type(2) {
        font-size: 12px;
      }
      .small {
        display: flex;
        justify-self: center;
        align-items: center;
        flex-wrap: wrap;
        width: 32px;
        position: absolute;
        top: 20px;
        right: 30px;
        .heart {
          color: #ccc;
          font-size: 24px;
        }
      }
    }

    // 配送
    .deliveryprice {
      width: 100%;
      display: flex;
      border-bottom: 20px solid #ccc;
      & > ul {
        width: 100%;
        height: 80px;
        display: flex;
        align-items: center;
        justify-content: space-around;
        & > li {
          width: 31%;
          padding: 0 10px;
        }
        & > li:nth-of-type(1),
        li:nth-of-type(2) {
          border-right: 1px solid #ccc;
        }
        .pricenum {
          font-size: 30px;
        }
      }
    }

    // 公告活动
    .activity {
      width: 100%;
      padding: 10px;
      .red {
        font-size: 12px;
        color: red;
        line-height: 26px;
        margin: 10px 20px 15px;
      }
      &>ul{
        width: 100%;
        
      }
    }
  }
}
</style>